package day14_io.demo06_Buffered字符缓冲流;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;

public class Demo03copycopy {
    public static void main(String[] args) throws Exception{
        File file = new File("E:\\csw\\Demo\\src");
        show(file);
        System.out.println(sum);
    }
    static int sum=0;
    public static void show(File file) throws Exception{
        File[] files = file.listFiles();
        for (File file1 : files) {
            if (file1.isFile()){
                BufferedReader br = new BufferedReader(new FileReader(file1.getAbsoluteFile()));
                String s;
                while ((s=br.readLine())!=null){
                    sum++;
                }
                br.close();
            }else {
                show(file1);
            }
        }
    }
}
